package com.nnnu.wsnackshop.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import jakarta.validation.constraints.Size;
import lombok.Data;



@Data
@Schema(description = "添加权限dto")
public class AddPermissionDTO {
    @NotBlank(message = "权限标识不能为空")
    @Size(max = 100, message = "权限标识长度不能超过100字符")
    @Pattern(regexp = "^[a-zA-Z0-9]+:[a-zA-Z0-9_]+$", message = "权限标识格式错误，应为【资源:操作】，如 user:create")
    @Schema(description = "权限标识，如 user:create", requiredMode = Schema.RequiredMode.REQUIRED)
    private String name;

    @Size(max = 255)
    @Schema(description = "权限描述")
    private String description;
}
